﻿using System.Linq;
using Christ3D.Domain.Interfaces;
using Christ3D.Domain.Models;
using Christ3D.Infra.Data.Context;
using Christ3D.Infrastruct.UoW;
using Dapper;
using Dommel;
using Microsoft.EntityFrameworkCore;

namespace Christ3D.Infra.Data.Repository
{
    /// <summary>
    /// Student仓储，操作对象还是领域对象
    /// </summary>
    public class StudentRepository : Repository<Student>, IStudentRepository
    {
        public StudentRepository(DbSession session) : base(session)
        {
        }

        public Student GetByEmail(string email)
        {
            return _session.Connection.FirstOrDefault<Student>(x => x.Email==(email));
        }
    }
}
